<template>
  <div class="send-node">
    <a-form
      :model="form"
      name="form"
      label-wrap
      :label-col="{ span: 24 }"
      :wrapper-col="{ span: 24 }"
      autocomplete="off"
    >
      <a-form-item
        label="节点名称"
        name="name"
        :rules="[{ required: true, message: '请输入节点名称', trigger: 'blur' }]"
      >
        <a-input v-model:value="form.name" placeholder="节点名称"></a-input>
      </a-form-item>
      <a-form-item name="approveType">
        <template #label> 预置抄送人员：<span class="desc">（可不设置，具体使用时可修改）</span> </template>
        <SetMember v-model:memberType="form.memberType" v-model:memberList="form.memberList" />
      </a-form-item>
    </a-form>
  </div>
</template>
<script lang="ts" setup name="WorkflowForm">
import { reactive, onBeforeUnmount } from 'vue'
import SetMember from '@@/components/setMember/index.vue'
const emit = defineEmits(['close'])
const props = defineProps({
  currentNode: {
    type: Object,
    default: () => {}
  }
})
const id = props.currentNode.data.id
const form = reactive(props.currentNode.data.properties)
form.id = id

onBeforeUnmount(() => {
  emit('close', form, id)
})

const close = () => {
  emit('close', form, id)
}

defineExpose({
  close
})
</script>
<style lang="less">
.send-node {
  width: 350px;
  .desc {
    font-size: 14px;
    color: #999;
  }
}
</style>
